<script setup>
defineProps({
  ext: Object
})

const layouts = [
  "prev, next",
  "prev, pager, next",
  "prev, pager, next, total",
  "total, prev, pager, next",
  "prev, pager, next, total",
  "prev, pager, next, jumper",
  "prev, pager, next, jumper, ->, total",
  "total, sizes, prev, pager, next, jumper"
]
</script>

<template>
  <div class="ele-prop-item elem-design-prop-logic" v-if="ext">
    <el-form ref="form" label-position="top" size="mini">
      <el-form-item label="仅一页隐藏">
        <el-radio-group v-model="ext.hideOnSinglePage">
          <el-radio :label="false">显示</el-radio>
          <el-radio :label="true">隐藏</el-radio>
        </el-radio-group>
      </el-form-item>

      <el-form-item label="上一页文字">
        <el-input
          v-model="ext.prevText"
          placeholder="上一页文字"
        />
      </el-form-item>
      <el-form-item label="下一页文字">
        <el-input
          v-model="ext.nextText"
          placeholder="下一页文字"
        />
      </el-form-item>

      <el-form-item label="显示模式（仅H5端）">
        <el-radio-group v-model="ext.mode">
          <el-radio label="simple">简单</el-radio>
          <el-radio label="multi">默认</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="显示页码个数（仅H5端）">
        <el-input-number
          v-model="ext.showPageSize"
        />
      </el-form-item>
      <el-form-item label="是否显示省略号（仅H5端）">
        <el-radio-group v-model="ext.forceEllipses">
          <el-radio :label="false">不显示</el-radio>
          <el-radio :label="true">显示</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="组件布局（仅web端）">
        <el-select v-model="ext.layout">
          <el-option v-for="l in layouts" :label="l" :value="l" />
        </el-select>
      </el-form-item>
      <el-form-item label="尺寸（仅web端）">
        <el-radio-group v-model="ext.size">
          <el-radio label="">默认</el-radio>
          <el-radio label="small">小</el-radio>
          <el-radio label="large">大</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="背景色（仅web端）">
        <el-radio-group
          v-model="ext.background"
        >
          <el-radio :label="false">无</el-radio>
          <el-radio :label="true">有</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="每页条数选择器（仅web端）">
        <el-input
          v-model="ext.pageSizes"
          placeholder="数字用逗号隔开，如：10, 20, 30"
        />
      </el-form-item>
    </el-form>
  </div>
</template>

<style lang="scss" scoped>
.effect-item {
  //width: 100%;
  line-height: 1.8;
  //height: 40px;
  cursor: pointer;
  border: 2px solid transparent;
  padding: 5px;
  border-radius: 5px;
  font-weight: bold;
  margin: 1px;

  &:hover {
    border-color: var(--j-border-color);
  }
  &.active {
    border-color: var(--j-color-primary);
  }
}
</style>
